﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package com.yy.ui.controls {
    import flash.events.*;
    import com.fminutes.vinciUI.events.*;
    import com.fminutes.vinciUI.core.*;

    public class ListItem extends UISprite implements IListItem {

        private var _selected:Boolean;
        private var _data:Object;
        private var _index:int;
        private var _dataIndex:int;

        public function ListItem(){
            this.init();
        }
        private function init():void{
            this.visible = false;
            addEventListener(MouseEvent.CLICK, this.onMouseClick);
        }
        private function onMouseClick(_arg1:MouseEvent):void{
            this.click();
        }
        protected function click():void{
            var _local1:UIEvent = new UIEvent(UIEvent.LISTITEM_CLICK);
            dispatchEvent(_local1);
        }
        public function get selected():Boolean{
            return (this._selected);
        }
        public function set selected(_arg1:Boolean):void{
            var _local2:UIEvent;
            this._selected = _arg1;
            if (this._selected){
                _local2 = new UIEvent(UIEvent.LISTITEM_SELECTED_CHANGE, true, false, this.data);
                dispatchEvent(_local2);
            };
        }
        public function get data():Object{
            return (this._data);
        }
        public function set data(_arg1:Object):void{
            if (_arg1 != null){
                this.visible = true;
            } else {
                this.visible = false;
                this.dispose();
            };
            this._data = _arg1;
        }
        public function get index():int{
            return (this._index);
        }
        public function set index(_arg1:int):void{
            this._index = _arg1;
        }
        private function dispose():void{
        }
        public function get dataIndex():int{
            return (this._dataIndex);
        }
        public function set dataIndex(_arg1:int):void{
            this._dataIndex = _arg1;
        }

    }
}//package com.fminutes.vinciUI.controls 
